package hangban.com.maochang.impl;


import hangban.com.maochang.dao.AirInfodateDao;
import hangban.com.maochang.pojo.AirInfo;
import hangban.com.maochang.util.BaseDao;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;


public class AirInfoDateDaoImpl extends BaseDao implements AirInfodateDao {
    @Override
    public List<AirInfo> getSelect(Date qi) throws SQLException {
        String sql="select * from Airinfo where  datefei=?";
        ResultSet rs = super.query(sql, new Object[]{qi});
        List<AirInfo> airInfos=new ArrayList<>();
        while (rs.next()){
            AirInfo airInfo=new AirInfo();
            airInfo.setId(rs.getInt("id"));
            airInfo.setHangcard(rs.getInt("hangcard"));
            airInfo.setMudi(rs.getString("mudi"));
            airInfo.setDatefei(rs.getDate("datefei"));
            airInfos.add(airInfo);
        }

        closeAll(rs.getStatement().getConnection(),rs.getStatement(),rs);

        return airInfos;
    }
}
